package com.bcu.calculus.controller;

import com.bcu.calculus.entity.*;
import com.bcu.calculus.service.JurisdictionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "10  权限模块")
@RestController
@RequestMapping("/api/Jurisdiction")
public class JurisdictionConrtoller {

    @Resource
    private JurisdictionService jurisdictionService;

    @ApiOperation(value = "增加")
    @PostMapping(value = "/insert")
    public Message<?> insert(Jurisdiction jurisdiction){
        return jurisdictionService.insert(jurisdiction);
    }


    @ApiOperation(value = "通过关键字删除")
    @DeleteMapping(value = "/deleteByPrimaryKey")
    public Message deleteByPrimaryKey(String jurisdictionId) {
        return jurisdictionService.deleteByPrimaryKey(jurisdictionId);
    }


    @ApiOperation(value = "通过主键修改")
    @PutMapping(value = "/updateByPrimaryKey")
    public Message updateByPrimaryKey(Jurisdiction jurisdiction){
        return jurisdictionService.updateByPrimaryKey(jurisdiction);
    }


    @ApiOperation(value = "通过关键字查询")
    @GetMapping(value = "/selectByPrimaryKey")
    public Message<Jurisdiction>selectByPrimaryKey(String jurisdictionId) {
        return jurisdictionService.selectByPrimaryKey(jurisdictionId);
    }


    @ApiOperation(value = "查询所有")
    @GetMapping(value = "/selectAllJurisdiction")
    public Message<List<Jurisdiction>> selectAllJurisdiction(){
        return jurisdictionService.selectAllJurisdiction();
    }

}
